<?php

/**
 * Paquete filter form base class.
 *
 * @package    courier
 * @subpackage filter
 * @author     Your name here
 */
abstract class BasePaqueteFormFilter extends BaseFormFilterPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'paq_peso'        => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'paq_nombre'      => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'paq_apellido'    => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'paq_descripcion' => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'paq_trackingnum' => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'paq_solicitud'   => new sfWidgetFormPropelChoice(array('model' => 'Solicitud', 'add_empty' => true)),
    ));

    $this->setValidators(array(
      'paq_peso'        => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'paq_nombre'      => new sfValidatorPass(array('required' => false)),
      'paq_apellido'    => new sfValidatorPass(array('required' => false)),
      'paq_descripcion' => new sfValidatorPass(array('required' => false)),
      'paq_trackingnum' => new sfValidatorPass(array('required' => false)),
      'paq_solicitud'   => new sfValidatorPropelChoice(array('required' => false, 'model' => 'Solicitud', 'column' => 'sol_id')),
    ));

    $this->widgetSchema->setNameFormat('paquete_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Paquete';
  }

  public function getFields()
  {
    return array(
      'paq_id'          => 'Number',
      'paq_peso'        => 'Number',
      'paq_nombre'      => 'Text',
      'paq_apellido'    => 'Text',
      'paq_descripcion' => 'Text',
      'paq_trackingnum' => 'Text',
      'paq_solicitud'   => 'ForeignKey',
    );
  }
}
